package com.qianyu.project.web.controller.ww;

import com.qianyu.project.entity.OutputProgressPlan;
import com.qianyu.project.entity.OutputProgressPlanSub;
import com.qianyu.project.service.IOutputProgressPlanService;
import com.qianyu.project.service.IOutputProgressPlanSubService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Author ww
 * @desc
 */
@RestController
@RequestMapping("output")
public class OutPutController {
    @Autowired
    IOutputProgressPlanService iOutputProgressPlanService;
    @Autowired
    IOutputProgressPlanSubService iOutputProgressPlanSubService;

    @PostMapping
    public Result save(@RequestBody Map<String,Object> outputProgressPlan){
        iOutputProgressPlanService.saveProgress(outputProgressPlan);
        return ResultTool.success();
    }

    @PostMapping("/outputsub")
    public Result saveBeach(@RequestBody Map<String,String> o){
        iOutputProgressPlanService.savebeach(o);
        return ResultTool.success();
    }

    @GetMapping
    public Result List(@RequestParam Map<String,String> params){

        return ResultTool.success(iOutputProgressPlanService.List(params));
    }
}
